<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
<div region="center" style="padding: 1px;">
<t:datagrid name="perPubAccountDetailList" title="个人对公明细查询" autoLoadData="false" actionUrl="judicialControll.do?perPubAccountDetailQuery" sortName="userName" fitColumns="true"
	idField="id" fit="true" queryMode="group" showPageList="false" pagination="true" showText="true">
	<%--   update-end--Author:tanghan  Date:20130713 for添加checkbox
	--%>
	<t:dgCol title="户名" field="custcn" query="true" hidden="true"  width="80"></t:dgCol>
	<t:dgCol title="账号" field="acctno" query="true" hidden="true" width="120"></t:dgCol>
	<t:dgCol title="交易日期" field="trandt"  query="true"  queryMode="group" width="120"></t:dgCol>
	
	<t:dgCol title="rowkey" field="rowkey" hidden="true" width="120"></t:dgCol>
	<t:dgCol title="子户号"  field="subsac"   width="120"></t:dgCol>
	<t:dgCol title="交易时间" field="trantm"   width="80"></t:dgCol>
	<t:dgCol title="交易流水" field="transq" width="120" ></t:dgCol>
	<t:dgCol title="借方发生额" field="loanline" width="80"></t:dgCol>
	<t:dgCol title="贷方发生额" field="lenderline" width="80"></t:dgCol>
	<t:dgCol title="账户余额" field="bal"    width="80"></t:dgCol>
	<t:dgCol title="摘要" field="smrycd" width="120"></t:dgCol>
	<t:dgCol title="对方账号" field="toacctno" width="80"></t:dgCol>
	<t:dgCol title="对方户名"  field="tocustname"  width="60"></t:dgCol>
	<t:dgCol title="账单流水" field="billsq" width="60" ></t:dgCol>
	<t:dgCol title="凭证类型" field="dcmttp" width="60" ></t:dgCol>
	<t:dgCol title="凭证号码" field="dcmtno" width="150" ></t:dgCol>
	<t:dgCol title="币种" field="crcycd"  width="60"></t:dgCol>
	<t:dgCol title="钞汇标志" field="csextg" width="60"></t:dgCol>
	<t:dgCol title="交易部门" field="tranbrnm" width="80"></t:dgCol>
	<t:dgCol title="记账柜员" field="bkusid" width="150"></t:dgCol>
	<t:dgCol title="客户号" field="custno" width="80"></t:dgCol>
	<t:dgCol title="机构号" field="brchno" width="80"></t:dgCol>
	<%--
	<t:dgCol title="现转标志" field="trantp" width="60" ></t:dgCol>
	--%>
	<t:dgToolBar title="导出Excel" icon="icon-search" onclick="perPubAccountDetailListExportXls();"></t:dgToolBar>

</t:datagrid></div>
</div>
<script type="text/javascript">
   $(document).ready(function(){
		$("input[name='trandt_begin']").attr("class","Wdate").attr("style","height:20px;width:90px;").click(function(){WdatePicker({dateFmt:'yyyyMMdd'});});
		$("input[name='trandt_end']").attr("class","Wdate").attr("style","height:20px;width:90px;").click(function(){WdatePicker({dateFmt:'yyyyMMdd'});});
	});
   function isNull(pa){
	  var resp='';
	  if(pa ==null || pa==''){
	    resp+=';';
	  }else{
	  	resp+=pa+ ';';
	  }
	   return resp;
	}
    function getParams(){
		var param;
	    var acctno= $("input[name='acctno']").val();
	    var custcn= $("input[name='custcn']").val();
	    var trandt_begin= $("input[name='trandt_begin']").val();
	    var trandt_end= $("input[name='trandt_end']").val();
	    
	    param =isNull(acctno) + isNull(custcn)+ isNull(trandt_begin) + isNull(trandt_end);
        return param;
    }
    
    
    function onLoadSuccess(){
       var startkey = getrowkey(1);
       var endkey = getrowkey(0);
       $('#perPubAccountDetailList').datagrid('options').queryParams={'startkey':startkey,'endkey':endkey,'param':getParams()};
       
    }
    function getrowkey(flag){
        var  rowkey;
    	var datas = $('#perPubAccountDetailList').datagrid('getRows');
    	var le ;
    	if(flag==0){//下一页
    	   le = $('#perPubAccountDetailList').datagrid('getData').rows[datas.length-1];
    	}else if(flag==1){//上一页
    	   le = $('#perPubAccountDetailList').datagrid('getData').rows[0];
    	}else{
    	  le ='';
    	  return '';
    	}
    	if(null != le && le !=''){
	    	for(var i in le){
	    		if(i=='rowkey'){
	    			rowkey=le[i];
    				return rowkey;
	    		}
	    	}
    	}
    }
    function perPubAccountDetailListExportXls(){
         var param = getParams();
    	JeecgExcelExport("judicialControll.do?perPubAccountDetailDown","perPubAccountDetailList");
    }
    function perPubAccountDetailsearch(){
    	var param = getParams();
    	$('#perPubAccountDetailList').datagrid({
    		url: 'judicialControll.do?perPubAccountDetailQuery&param='+param+'&field=acctno,custcn,trandt,trandt_begin,trandt_end,rowkey,subsac,trantm,transq,loanline,lenderline,bal,smrycd,toacctno,tocustname,billsq,trantp,dcmttp,crcycd,csextg,tranbr,bkusid,custno,brchno,tranbrnm,'
    	});
    }
</script>